//Page 432
#include <algorithm>
#include <set>
#include <fstream>
#include <iostream>
#include <iterator>
#include <string>
using namespace std ;

int main ( )
{
	ifstream inf("wordSet.cpp");
	set<string> words ;
	string word ;
	
	while ( inf >> word )
	{
		words.insert(word) ;
	}

	copy( words.begin(), words.end(), ostream_iterator<string>(cout, " ") ) ;
	cout<< endl << "Number of unique words: " << words.size() << endl ;

	return 0 ;
}
